home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / demo / medit.zip / MAGMAED.H < prev    next >
Text File  |  1994-09-21  |  9KB  |  299 lines

  1. /*===========================================================================*/
  2. /*                                                                           */
  3. /* File    : MAGMAED.H                                                       */
  4. /*                                                                           */
  5. /* Purpose : Public header file for the Magma Editor                         */
  6. /*                                                                           */
  7. /* History :                                                                 */
  8. /*                                                                           */
  9. /* (C) Copyright 1993-1994 Marc Adler/Magma Systems     All Rights Reserved  */
  10. /*===========================================================================*/
  11.  
  12. /*
  13.   Typedefs for the macro interpreter
  14. */
  15. typedef VOID FAR *HPROGRAM;
  16.  
  17.  
  18. /*
  19.   Window styles for the editor
  20. */
  21.  
  22. /*
  23.   ES_WANTTAB
  24.     This is used when an edit control is part of a dialog box. The editor
  25.     examines this style when it processes the WM_GETDLGCODE message in
  26.     order to let the Windows dialog manager know whether it want to keep
  27.     the tabs.
  28. */
  29. #define ES_WANTTAB        0x00008000L
  30.  
  31. /*
  32.   ES_OWNERDRAW
  33.     Used to allow the application to render a line of the edit control
  34. */
  35. #define ES_OWNERDRAW      0x00004000L
  36. #define ES_HASSTRINGS     0x00000200L
  37. #define ODT_EDIT          99
  38.  
  39. typedef struct tagMEDRAWITEMSTRUCT
  40. {
  41.   UINT  CtlType;
  42.   UINT  CtlID;
  43.   UINT  itemID;
  44.   UINT  itemAction;
  45.   UINT  itemState;
  46.   HWND  hwndItem;
  47.   HDC   hDC;
  48.   RECT  rcItem;
  49.   DWORD itemData;
  50.   LPSTR lpText;
  51. } MEDRAWITEMSTRUCT, NEAR *PMEDRAWITEMSTRUCT, FAR *LPMEDRAWITEMSTRUCT;
  52.  
  53. typedef struct tagMEDELETEITEMSTRUCT
  54. {
  55.   UINT  CtlType;
  56.   UINT  CtlID;
  57.   UINT  itemID;
  58.   HWND  hwndItem;
  59.   DWORD itemData;
  60.   LPSTR lpText;
  61. } MEDELETEITEMSTRUCT, NEAR *PMEDELETEITEMSTRUCT, FAR *LPMEDELETEITEMSTRUCT;
  62.  
  63. typedef struct tagMEMEASUREITEMSTRUCT
  64. {
  65.   UINT  CtlType;
  66.   UINT  CtlID;
  67.   UINT  itemID;
  68.   UINT  itemWidth;
  69.   UINT  itemHeight;
  70.   DWORD itemData;
  71.   LPSTR lpText;
  72. } MEMEASUREITEMSTRUCT, NEAR *PMEMEASUREITEMSTRUCT, FAR *LPMEMEASUREITEMSTRUCT;
  73.  
  74.  
  75.  
  76. /*
  77.   ES_USEFORMATTING
  78. */
  79. #define ES_USEFORMATTING  0x00002000L
  80.  
  81.  
  82. /*
  83.   Editor messages
  84. */
  85. #define WM_BASE   (WM_USER + 1313)
  86.  
  87. #define ME_SELFINSERT      WM_BASE+0
  88. #define ME_FSEARCH         WM_BASE+1
  89. #define ME_BSEARCH         WM_BASE+2
  90. #define ME_FREPLACE        WM_BASE+3
  91. #define ME_BREPLACE        WM_BASE+4
  92. #  define SEARCH_CASE_INSENSITIVE    0x0001
  93. #  define SEARCH_NO_REGEXP           0x0002
  94. #  define SEARCH_SELECTMATCH         0x0004
  95. #  define SEARCH_WHOLE_WORD_ONLY     0x0008
  96. #  define SEARCH_PROMPT_ON_REPLACE   0x0100
  97. #  define SEARCH_BACKWARD            0x1000
  98.  
  99.  
  100. #define ME_DELLINE         WM_BASE+5
  101. #define ME_APPENDLINE      WM_BASE+6
  102. #define ME_INSERTLINE      WM_BASE+7
  103. #define ME_CUT             WM_BASE+8
  104. #define ME_CUTAPPEND       WM_BASE+9
  105. #define ME_RESETMARK       WM_BASE+10
  106. #define ME_COPY            WM_BASE+11
  107. #define ME_DUPLINE         WM_BASE+12
  108. #define ME_PASTE           WM_BASE+13
  109. #define ME_BACKSPACE       WM_BASE+14
  110. #define ME_DELWORD         WM_BASE+15
  111. #define ME_DELCHAR         WM_BASE+16
  112. #define ME_DELEOL          WM_BASE+17
  113. #define ME_TOGGLEINSERT    WM_BASE+18
  114. # define INSERTMODE_TOGGLE  0
  115. # define INSERTMODE_ON      1
  116. # define INSERTMODE_OFF     2
  117. #define ME_TAB             WM_BASE+19
  118. #define ME_BACKTAB         WM_BASE+20
  119. #define ME_UNDO            WM_BASE+21
  120. #define ME_REDO            WM_BASE+22
  121. #define ME_SEARCHAGAIN     WM_BASE+23
  122. #define ME_REPLACEAGAIN    WM_BASE+24
  123.  
  124. #define ME_MOVEUP          WM_BASE+30
  125. #define ME_MOVEDOWN        WM_BASE+31
  126. #define ME_MOVELEFT        WM_BASE+32
  127. #define ME_MOVERIGHT       WM_BASE+33
  128. #define ME_MOVEBOL         WM_BASE+34
  129. #define ME_MOVEEOL         WM_BASE+35
  130. #define ME_MOVENEXTWORD    WM_BASE+36
  131. #define ME_MOVEPREVWORD    WM_BASE+37
  132. #define ME_MOVENEXTPARA    WM_BASE+38
  133. #define ME_MOVEPREVPARA    WM_BASE+39
  134. #define ME_MOVETOPOFWINDOW WM_BASE+40
  135. #define ME_MOVEBOTOFWINDOW WM_BASE+41
  136. #define ME_MOVENEXTPAGE    WM_BASE+42
  137. #define ME_MOVEPREVPAGE    WM_BASE+43
  138. #define ME_MOVETOPOFBUFFER WM_BASE+44
  139. #define ME_MOVEBOTOFBUFFER WM_BASE+45
  140. #define ME_MOVETOBOOKMARK  WM_BASE+46
  141. #define ME_SETBOOKMARK     WM_BASE+47
  142. #define ME_GOTOLINE        WM_BASE+48
  143. #  define GOTOLINE_ABS   1
  144. #  define GOTOLINE_LAST  2
  145. #  define GOTOLINE_NEXT  3
  146. #  define GOTOLINE_PREV  4
  147. #define ME_REMOVEBOOKMARK  WM_BASE+49
  148. #  define BOOKMARK_REMOVEALL  ((WPARAM) -1)
  149.  
  150. #define ME_MATCHBRACE      WM_BASE+50
  151. #define ME_MARKLINE        WM_BASE+51
  152. #define ME_MARKLINERANGE   WM_BASE+52
  153. #define ME_INSERTCHAR      WM_BASE+53
  154. #define ME_UNDOLINES       WM_BASE+54
  155. #define ME_STREAMMARK      WM_BASE+55
  156. #define ME_RECTMARK        WM_BASE+56
  157. #define ME_CASELOWER       WM_BASE+57
  158. #define ME_CASEUPPER       WM_BASE+58
  159.  
  160. #define ME_OPENFILE        WM_BASE+60
  161. #define ME_WRITEFILE       WM_BASE+61
  162. /*
  163.   Return codes for EM_WRITEFILE
  164. */
  165. #  define EN_ERRCREATING  (-1)
  166. #  define EN_ERRWRITING   (-2)
  167.  
  168. /*
  169.   Options and settings
  170. */
  171. #define ME_SETBKCOLOR      WM_BASE+70
  172. #define ME_SETTEXTCOLOR    WM_BASE+71
  173. #define ME_SETOPTION       WM_BASE+72
  174. #define ME_QUERYOPTION     WM_BASE+73
  175. #define ME_OPTIONDLG       WM_BASE+74
  176. #define ME_SETFONT         WM_BASE+75
  177. #define ME_TOGGLEWORDWRAP  WM_BASE+76
  178. # define WORDWRAP_OFF     0
  179. # define WORDWRAP_ON      1
  180. # define WORDWRAP_TOGGLE  2
  181.  
  182. #define ME_HELPONWORD      WM_BASE+80
  183. #define ME_GETCURRWORD     WM_BASE+81
  184.  
  185. #define ME_KEYMACDEFINE    WM_BASE+90
  186. #define ME_KEYMACPLAY      WM_BASE+91
  187. #define ME_KEYMACPAUSE     WM_BASE+92
  188. #define ME_PROGFROMKEYMAC  WM_BASE+93
  189.  
  190. /*
  191.   Misc
  192. */
  193. #define ME_QUERYSEARCHSTRING   WM_BASE+100
  194. #define ME_QUERYSTATUS         WM_BASE+101
  195. #define ME_INSERTSTRING        WM_BASE+102
  196. # define ME_INSERT_MODE      0
  197. # define ME_OVERSTRIKE_MODE  1
  198. #define ME_GETITEMDATA         WM_BASE+103
  199. #define ME_SETITEMDATA         WM_BASE+104
  200. #define ME_GETITEMHEIGHT       WM_BASE+105
  201. #define ME_SETITEMHEIGHT       WM_BASE+106
  202. #define ME_QUERYNUMWORDS       WM_BASE+107
  203. #define ME_TRIMTEXT            WM_BASE+108
  204.  #define TRIM_LEADING_BLANKS   0x0001
  205.  #define TRIM_TRAILING_BLANKS  0x0002
  206.  #define TRIM_COMPRESS_BLANKS  0x0004
  207. #define ME_CENTER              WM_BASE+109
  208. #define ME_REFORMAT            WM_BASE+110
  209. #define ME_REFORMATALL         WM_BASE+111
  210.  
  211. #define WM_BASE_LAST_MSG       WM_BASE+200
  212.  
  213.  
  214. /*
  215.   Notification messages
  216. */
  217. #define MEN_UPDATE             WM_BASE+200
  218.  
  219. /*
  220.   Test bed for messages
  221. */
  222. #define WM_MSGTESTBASE         WM_BASE+900
  223.  
  224.  
  225. /*
  226.   The following messages are compatible with the Chicago RTF edit control
  227. */
  228. #define  EM_CHARFROMPOS        (WM_USER + 1213)
  229. #define  EM_EXGETSEL           (WM_USER + 1214)
  230. #define  EM_EXLINEFROMCHAR     (WM_USER + 1215)
  231. #define  EM_EXSETSEL           (WM_USER + 1216)
  232. #define  EM_GETSELTEXT         (WM_USER + 1217)
  233. #define  EM_GETTEXTRANGE       (WM_USER + 1218)
  234. #define  EM_POSFROMCHAR        (WM_USER + 1219)
  235. #define  EM_SELECTIONTYPE      (WM_USER + 1220)
  236. #define  EM_SETBKGNDCOLOR      (WM_USER + 1221)
  237. #define  EM_GETCHARFORMAT      (WM_USER + 1222)
  238. #define  EM_SETCHARFORMAT      (WM_USER + 1223)
  239.   #define SCF_SELECTION   0x0001
  240.   #define SCF_WORD        0x0002
  241.  
  242.  
  243. typedef struct tagCharRange
  244. {
  245.   DWORD dwStart;
  246.   DWORD dwEnd;
  247. } CHARRANGE, *PCHARRANGE, FAR *LPCHARRANGE;
  248.  
  249.  
  250. #ifndef RC_INVOKED
  251. typedef struct tagMeStatus
  252. {
  253.   BOOL bInsert;
  254.   UINT column;
  255.   LONG row;
  256.   LONG currLineNum;
  257.   LONG nTotalLines;
  258. } MAGMAED_STATUS, FAR *LPMAGMAED_STATUS;
  259. #endif
  260.  
  261.  
  262. /*
  263.   Structures related to formatting
  264. */
  265. #if !defined(_DEFS_H)
  266.  
  267. typedef struct tagCharFormat
  268. {
  269.   DWORD    dwMask;
  270.     #define CFM_BOLD        0x00000001L
  271.     #define CFM_ITALIC      0x00000002L
  272.     #define CFM_UNDERLINE   0x00000004L
  273.     #define CFM_STRIKEOUT   0x00000008L
  274.     #define CFM_PROTECTED   0x00000000L
  275.     #define CFM_SIZE        0x80000000L
  276.     #define CFM_COLOR       0x40000000L
  277.     #define CFM_FACE        0x20000000L
  278.     #define CFM_OFFSET      0x10000000L
  279.     #define CFM_BITMAP      0x08000000L   /* Magma specific */
  280.   DWORD    dwEffects;
  281.     #define CFE_BOLD        0x00000001L
  282.     #define CFE_ITALIC      0x00000002L
  283.     #define CFE_UNDERLINE   0x00000004L
  284.     #define CFE_STRIKEOUT   0x00000008L
  285.     #define CFE_PROTECTED   0x00000010L
  286.     #define CFE_AUTOCOLOR   0x40000000L
  287.     #define CFE_BITMAP      0x08000000L   /* Magma specific */
  288.   LONG     yHeight;                 /* height of line in twips (1/1440")    */
  289.   LONG     yOffset;                 /* >0 for superscript, <0 for subscript */
  290.   COLORREF crTextColor;             /* Text color */
  291.   BYTE     bPitchAndFamily;         /* same as LOGFONT's chPitchAndFamily */
  292.   BYTE     szFaceName[LF_FACESIZE]; /* same as LOGFONT's lfFacename       */
  293.  
  294.   /* These are in the Magma Editor DLL but not in Chicago */
  295.   HANDLE   hObject;                 /* generic object - Bitmap, font, MF  */
  296. } CHARFORMAT, *PCHARFORMAT, FAR *LPCHARFORMAT;
  297.  
  298. #endif
  299.